home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / t / toeutilities25.dms / toeutilities25.adf / Cpu / RebootPatch.asm < prev   
Assembly Source File  |  1995-08-05  |  880b  |  59 lines

  1. START    move.l    $4.w,a6
  2.     cmpi.w    #37,LIB_VERSION(a6)
  3.     bcs.s    quit
  4.     jsr    _LVOForbid(a6)
  5.     move.l    #Patch,d0
  6.     move.w    #_LVOColdReboot,a0
  7.     move.l    a6,a1
  8.     jsr    _LVOSetFunction(a6)
  9.     lea    START-4(pc),a0
  10.     clr.l    (a0)
  11.     jsr    _LVOCacheClearU(a6)
  12.     jsr    _LVOPermit(a6)
  13. quit    moveq    #0,d0
  14.     rts
  15.  
  16.     dc.b    "$VER: RebootPatch 1.0 (12.3.95) by Martin Berndt",0
  17.  
  18.     section    PatchCode,CODE_C
  19.  
  20. Patch    jsr    _LVOCacheClearU(a6)
  21.     moveq    #0,d0
  22.     moveq    #-1,d1
  23.     jsr    _LVOCacheControl(a6)
  24.     jsr    _LVODisable(a6)
  25.     jsr    _LVOSuperState(a6)
  26.     move.w    #$4000,$dff09a
  27.     move.w    AttnFlags(a6),d0
  28.     btst    #AFB_68030,d0
  29.     beq.s    .reboot
  30.     btst    #AFB_68040,d0
  31.     bne.s    .mmu040
  32.  
  33.     opt    p=68030
  34.  
  35.     clr.l    -(sp)
  36.     pmove.l    (sp),tc
  37.     pflusha
  38.     addq.w    #4,sp
  39.     bra.s    .reboot
  40.  
  41.     opt    p=68040
  42.  
  43. .mmu040    moveq    #0,d0
  44.     movec    d0,tc
  45.     pflusha
  46.  
  47.     opt    p=68000
  48.  
  49. .reboot    lea    $1000004,a4
  50.     suba.l    -$18(a4),a4
  51.     move.l    (a4),a4
  52.     subq.w    #2,a4
  53.     bra.s    .reset
  54.     cnop    0,4
  55. .reset    reset
  56.     jmp    (a4)
  57.  
  58.     end
  59.